import {
    d as e,
    r as a,
    b as t,
    e as s,
    u as l,
    f as o,
    g as i,
    w as r,
    o as n,
    h as d,
    i as p,
    j as c,
    t as m,
    a as u,
    k as x,
    l as g,
    m as v,
    n as f,
    c as h,
    p as _,
    q as w,
    T as y,
    s as b,
    v as j,
    x as R,
    y as k,
    z as I
} from "./index.115af62d1729265196717.js";
import {T as P, _ as F, a as q} from "./LocaleDropdown.vue_vue_type_script_setup_true_lang.80c51c531729265196717.js";
import {u as L, F as T} from "./useForm.9355f9ab1729265196717.js";
import {E as A} from "./el-button.c1876bd01729265196717.js";
import {l as C} from "./index.76b9f3221729265196717.js";
import {u as D} from "./useValidator.d7fa223e1729265196717.js";/* empty css                                                                                     */
import {_ as E} from "./_plugin-vue_export-helper.1b428a4d1729265196717.js";
import "./index.eec34c841729265196717.js";
import "./el-divider.111259cd1729265196717.js";
import "./el-form-item.eb8d765c1729265196717.js";

const S = {class: "text-2xl font-bold text-center w-[100%]"}, z = {class: "w-[100%]"}, N = E(e({
        __name: "LoginForm", setup(e) {
            const h = a({}), {required: _} = D(), w = t(), y = s(), {
                    currentRoute: b,
                    addRoute: j,
                    push: R
                } = l(), {wsCache: k} = o(), {t: I} = v(), P = {username: [_()], password: [_()]},
                F = i([{field: "title", colProps: {span: 24}}, {
                    field: "username",
                    label: I("login.username"),
                    value: "",
                    component: "Input",
                    colProps: {span: 24},
                    componentProps: {placeholder: I("login.usernamePlaceholder")}
                }, {
                    field: "passwd",
                    label: I("login.password"),
                    value: "",
                    component: "InputPassword",
                    colProps: {span: 24},
                    componentProps: {style: {width: "100%"}, placeholder: I("login.passwordPlaceholder")}
                }, {field: "tool", colProps: {span: 24}}, {field: "login", colProps: {span: 24}}, {
                    field: "otherIcon",
                    colProps: {span: 24}
                }]), {register: q, elFormRef: E, methods: N} = L(), V = a(!1), J = a("");
            r((() => b.value), (e => {
                var a;
                J.value = null == (a = null == e ? void 0 : e.query) ? void 0 : a.redirect
            }), {immediate: !0});
            const M = async () => {
                const e = u(E);
                await (null == e ? void 0 : e.validate((async e => {
                    if (e) {
                        V.value = !0;
                        const {getFormData: e} = N, a = await e();
                        try {
                            const e = await C(a);
                            e && (localStorage.setItem("playVoiceFlag", "false"), h.value.avatar = e.data.avatar ? e.data.avatar : "", h.value.userId = e.data.id ? e.data.id : "", h.value.loginName = e.data.login_name ? e.data.login_name : "", localStorage.setItem("userInfo", JSON.stringify(h.value)), k.set(w.getUserInfo, e.data), w.getDynamicRouter ? O() : (await y.generateRoutes("admin").catch((() => {
                            })), y.getAddRouters.forEach((e => {
                                j(e)
                            })), y.setIsAddRouters(!0), R({path: J.value || y.addRouters[0].path})))
                        } finally {
                            V.value = !1
                        }
                    }
                })))
            }, O = async () => {
                o();
                const e = f;
                await y.generateRoutes("admin", e).catch((() => {
                })), y.getAddRouters.forEach((e => {
                    j(e)
                })), y.setIsAddRouters(!0), R({path: J.value || y.addRouters[0].path})
            };
            return (e, a) => (n(), d(u(T), {
                schema: F,
                rules: P,
                "label-position": "top",
                "hide-required-asterisk": "",
                size: "large",
                class: "dark:border-1 dark:border-[var(--el-border-color)] dark:border-solid",
                onRegister: u(q)
            }, {
                title: p((() => [c("h2", S, m(u(I)("login.login")), 1)])),
                login: p((() => [c("div", z, [x(u(A), {
                    loading: V.value,
                    type: "primary",
                    class: "w-[100%]",
                    onClick: M
                }, {default: p((() => [g(m(u(I)("login.login")), 1)])), _: 1}, 8, ["loading"])])])),
                _: 1
            }, 8, ["schema", "onRegister"]))
        }
    }), [["__scopeId", "data-v-12ba2114"]]), V = e => (k("data-v-382d9c46"), e = e(), I(), e),
    J = {class: "relative h-full flex mx-auto"}, M = {class: "flex items-center relative text-white"},
    O = V((() => c("img", {src: q, alt: "", class: "w-48px h-48px mr-10px"}, null, -1))),
    U = {class: "text-20px font-bold"}, $ = {class: "flex justify-center items-center h-[calc(100%-60px)]"},
    B = V((() => c("img", {
        src: "/assets/svg/login-box-bg.fec910441729265196717.svg",
        key: "1",
        alt: "",
        class: "w-350px"
    }, null, -1))), G = {class: "text-3xl text-white", key: "2"},
    H = {class: "mt-5 font-normal text-white text-14px", key: "3"},
    K = {class: "flex-1 p-30px <sm:p-10px dark:bg-v-dark relative"},
    Q = {class: "flex justify-between items-center text-white @2xl:justify-end @xl:justify-end"},
    W = {class: "flex items-center @2xl:hidden @xl:hidden"},
    X = V((() => c("img", {src: q, alt: "", class: "w-48px h-48px mr-10px"}, null, -1))),
    Y = {class: "text-20px font-bold"}, Z = {class: "flex justify-end items-center space-x-10px"},
    ee = {class: "h-full flex items-center m-auto w-[100%] @2xl:max-w-500px @xl:max-w-500px @md:max-w-500px @lg:max-w-500px"},
    ae = E(e({
        __name: "Login", setup(e) {
            const {getPrefixCls: s} = R(), l = s("login"), o = t(), {t: i} = v(), r = a(!0), g = () => {
                r.value = !1
            };
            return (e, a) => (n(), h("div", {class: _([u(l), "h-[100%] relative <xl:bg-v-dark <sm:px-10px <xl:px-10px <md:px-10px"])}, [c("div", J, [c("div", {class: _(`${u(l)}__left flex-1 bg-gray-500 bg-opacity-20 relative p-30px <xl:hidden`)}, [c("div", M, [O, c("span", U, m(u(w)(u(o).getTitle)), 1)]), c("div", $, [x(y, {
                appear: "",
                tag: "div",
                "enter-active-class": "animate__animated animate__bounceInLeft"
            }, {
                default: p((() => [B, c("div", G, m(u(i)("login.welcome")), 1), c("div", H, m(u(i)("login.message")), 1)])),
                _: 1
            })])], 2), c("div", K, [c("div", Q, [c("div", W, [X, c("span", Y, m(u(w)(u(o).getTitle)), 1)]), c("div", Z, [x(u(P)), x(u(F), {class: "<xl:text-white dark:text-white"})])]), x(j, {
                appear: "",
                "enter-active-class": "animate__animated animate__bounceInRight"
            }, {
                default: p((() => [c("div", ee, [r.value ? (n(), d(u(N), {
                    key: 0,
                    class: "p-20px h-auto m-auto <xl:rounded-3xl <xl:light:bg-white",
                    onToRegister: g
                })) : b("", !0)])])), _: 1
            })])])], 2))
        }
    }), [["__scopeId", "data-v-382d9c46"]]);
export {ae as default};
